<?php
// 9/25/2009: where is location_data?


if (!defined('EXPONENT')) exit('');

$item = $db->selectObject('file', 'id=' . intval($_GET['id']));
if ($item ) {
	// 9/25/2005: Immanuel192 remove this code because it's not check user permission
	/*$loc = unserialize($item->location_data);
	$iloc = exponent_core_makeLocation($loc->mod, $loc->src, $item->id);
	
	if (exponent_permissions_check('delete', $loc) ||
		exponent_permissions_check('delete', $iloc)*/
	if (filemanagermodule::_CanUpload() || ($user->id == $item->poster))
	{
		$db->delete('file', 'id=' . $item->id);
		unlink(BASE . $item->directory . "/" . $item->filename);

		$cat_id=0;
		if (isset($_REQUEST['cat_id']))
			$cat_id=intval($_REQUEST['cat_id']);
		header('Location: '.URL_FULL."modules/filemanagermodule/actions/picker.php?id={$cat_id}");
	} else {
		echo SITE_403_HTML;
	}
} else {
	echo SITE_404_HTML;
}

?>
